home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / mdishe / mdimain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-12-29  |  13.5 KB  |  424 lines

  1. VERSION 2.00
  2. Begin MDIForm mdiMain 
  3.    Caption         =   "Main Applicaton Frame"
  4.    ClientHeight    =   5970
  5.    ClientLeft      =   2430
  6.    ClientTop       =   2265
  7.    ClientWidth     =   9015
  8.    Height          =   6660
  9.    HelpContextID   =   23
  10.    Icon            =   0
  11.    Left            =   2370
  12.    LinkTopic       =   "Form1"
  13.    Top             =   1635
  14.    Width           =   9135
  15.    Begin SSPanel ToolbarPanel 
  16.       Align           =   1  'Align Top
  17.       Alignment       =   3  'Right Justify - TOP
  18.       AutoSize        =   3  'AutoSize Child To Panel
  19.       BackColor       =   &H00C0C0C0&
  20.       BevelInner      =   2  'Raised
  21.       BevelOuter      =   0  'None
  22.       BorderWidth     =   0
  23.       Font3D          =   0  'None
  24.       ForeColor       =   &H00800000&
  25.       Height          =   495
  26.       HelpContextID   =   82
  27.       Left            =   0
  28.       TabIndex        =   0
  29.       Top             =   0
  30.       Width           =   9015
  31.       Begin PictureClip PicClip1 
  32.          Cols            =   4
  33.          Location        =   "1440,330,60,5040"
  34.       End
  35.       Begin CommonDialog CMDialog1 
  36.          Left            =   7260
  37.          Top             =   0
  38.       End
  39.       Begin SSCommand Toolbar 
  40.          AutoSize        =   2  'Adjust Button Size To Picture
  41.          BevelWidth      =   0
  42.          Font3D          =   0  'None
  43.          Height          =   360
  44.          Index           =   2
  45.          Left            =   840
  46.          TabIndex        =   5
  47.          Tag             =   "Print"
  48.          Top             =   60
  49.          Width           =   390
  50.       End
  51.       Begin SSCommand Toolbar 
  52.          AutoSize        =   2  'Adjust Button Size To Picture
  53.          BevelWidth      =   0
  54.          Font3D          =   0  'None
  55.          Height          =   360
  56.          Index           =   3
  57.          Left            =   1230
  58.          TabIndex        =   4
  59.          Tag             =   "Save"
  60.          Top             =   60
  61.          Width           =   390
  62.       End
  63.       Begin SSCommand Toolbar 
  64.          AutoSize        =   2  'Adjust Button Size To Picture
  65.          BevelWidth      =   0
  66.          Font3D          =   0  'None
  67.          Height          =   360
  68.          Index           =   1
  69.          Left            =   450
  70.          TabIndex        =   3
  71.          Tag             =   "Open an existing database"
  72.          Top             =   60
  73.          Width           =   390
  74.       End
  75.       Begin SSCommand Toolbar 
  76.          AutoSize        =   2  'Adjust Button Size To Picture
  77.          BevelWidth      =   0
  78.          Font3D          =   0  'None
  79.          Height          =   360
  80.          Index           =   0
  81.          Left            =   60
  82.          TabIndex        =   2
  83.          Tag             =   "Create a new database"
  84.          Top             =   60
  85.          Width           =   390
  86.       End
  87.       Begin Label lblHelpTip 
  88.          AutoSize        =   -1  'True
  89.          BackColor       =   &H0000FFFF&
  90.          BorderStyle     =   1  'Fixed Single
  91.          Caption         =   "lblHelpTip"
  92.          FontBold        =   0   'False
  93.          FontItalic      =   0   'False
  94.          FontName        =   "MS Sans Serif"
  95.          FontSize        =   8.25
  96.          FontStrikethru  =   0   'False
  97.          FontUnderline   =   0   'False
  98.          Height          =   225
  99.          Left            =   8040
  100.          TabIndex        =   6
  101.          Top             =   120
  102.          Visible         =   0   'False
  103.          Width           =   735
  104.       End
  105.       Begin Label Label1 
  106.          Alignment       =   2  'Center
  107.          AutoSize        =   -1  'True
  108.          BackColor       =   &H00C0C0C0&
  109.          FontBold        =   0   'False
  110.          FontItalic      =   0   'False
  111.          FontName        =   "MS Sans Serif"
  112.          FontSize        =   8.25
  113.          FontStrikethru  =   0   'False
  114.          FontUnderline   =   0   'False
  115.          Height          =   195
  116.          Left            =   6420
  117.          TabIndex        =   1
  118.          Top             =   120
  119.          Width           =   495
  120.       End
  121.    End
  122.    Begin Menu mnuFile 
  123.       Caption         =   "&File"
  124.       HelpContextID   =   4
  125.       Begin Menu mnuFileNew 
  126.          Caption         =   "&New..."
  127.          HelpContextID   =   5
  128.       End
  129.       Begin Menu mnuFileOpen 
  130.          Caption         =   "&Open..."
  131.          HelpContextID   =   6
  132.       End
  133.       Begin Menu mnuFileSepBar1 
  134.          Caption         =   "-"
  135.       End
  136.       Begin Menu mnuFileCompact 
  137.          Caption         =   "&Compact Database..."
  138.          HelpContextID   =   7
  139.       End
  140.       Begin Menu mnuFileRepair 
  141.          Caption         =   "&Repair Database..."
  142.          HelpContextID   =   8
  143.       End
  144.       Begin Menu mnuFileSepBar2 
  145.          Caption         =   "-"
  146.       End
  147.       Begin Menu mnuFileExit 
  148.          Caption         =   "E&xit"
  149.          HelpContextID   =   9
  150.       End
  151.    End
  152.    Begin Menu mnuEdit 
  153.       Caption         =   "&Edit"
  154.       HelpContextID   =   16
  155.    End
  156.    Begin Menu mnuWindow 
  157.       Caption         =   "&Window"
  158.       HelpContextID   =   18
  159.       WindowList      =   -1  'True
  160.       Begin Menu mnuWindowCascade 
  161.          Caption         =   "&Cascade"
  162.       End
  163.       Begin Menu mnuWindowTileHoriz 
  164.          Caption         =   "Tile &Horizontal"
  165.       End
  166.       Begin Menu mnuWindowTileVert 
  167.          Caption         =   "Tile &Vertical"
  168.       End
  169.       Begin Menu mnuWindowSepBar1 
  170.          Caption         =   "-"
  171.       End
  172.       Begin Menu mnuWindowCloseAll 
  173.          Caption         =   "&Close All"
  174.       End
  175.       Begin Menu mnuWindowArrange 
  176.          Caption         =   "&Arrange Icons"
  177.       End
  178.    End
  179.    Begin Menu mnuHelp 
  180.       Caption         =   "&Help"
  181.       HelpContextID   =   19
  182.       Begin Menu mnuHelpContents 
  183.          Caption         =   "&Contents..."
  184.       End
  185.       Begin Menu mnuHelpSearch 
  186.          Caption         =   "&Search..."
  187.       End
  188.       Begin Menu mnuHelpSepBar1 
  189.          Caption         =   "-"
  190.       End
  191.       Begin Menu mnuHelpOnHelp 
  192.          Caption         =   "&How to use Help.."
  193.       End
  194.       Begin Menu mnuHelpSepBar2 
  195.          Caption         =   "-"
  196.       End
  197.       Begin Menu mnuHelpOrderInformation 
  198.          Caption         =   "&Ordering Information"
  199.       End
  200.       Begin Menu mnuHelpAbout 
  201.          Caption         =   "&About..."
  202.       End
  203.    End
  204. ' ********************************************************
  205. '        MDI Standard Application Shell
  206. ' ********************************************************
  207. ' SUMMARY
  208. ' -------
  209. ' This file is part of an MDI application "skeleton"
  210. ' created by John Blessing of Leigh Business Enterprises Ltd.
  211. ' FEATURES
  212. ' --------
  213. ' Selection of application database.
  214. ' Compact/Repair of database.
  215. ' 'Helptips' on toolbar items.
  216. ' Support for Help files.
  217. ' MDI child forms tiling etc.
  218. ' Error trapping.
  219. ' 'Nag' screen support for shareware authors.
  220. ' Support for 3D dialogs (switched off in design mode
  221. '   to prevent GPFs)
  222. ' USE
  223. ' ---
  224. ' You need VB Pro to use this shell, although it could be
  225. ' modified to run under the standard edition.
  226. ' You will need to set up some information in APP.BAS,
  227. ' particularly in SetAppInfo().  You will also need to add
  228. ' your own application specific code to this module.
  229. ' DISTRIBUTION
  230. ' ------------
  231. ' This program is "FreeWare" and may be used and distributed
  232. ' as you wish.
  233. ' It incorporates some ideas/code from other authors and these
  234. ' are acknowledged in the appropriate module.
  235. ' We hope that you will find it useful.  If you wish to discuss it
  236. ' then please e-mail us on Compuserve 100444,623.
  237. ' ADVERTISEMENT!
  238. ' --------------
  239. ' Are you looking for a helpdesk system? Or does your company
  240. ' want to track and monitor the progress of any work activity?
  241. ' We market a system which could be of interest to you.
  242. ' PROGRESS is available for download from the Business section
  243. ' of the Windows Shareware forum on Compuserve
  244. ' (filename PRGRSS10.ZIP).  It's a large program, so in the
  245. ' same section you will also find the help files and
  246. ' documentation as  PRGSSDOC.ZIP which is quicker to download
  247. ' and will give you a good idea of the functionality of PROGRESS.
  248. ' Dec 1994
  249. Option Explicit
  250. '======================================================================
  251. 'Form/Module:
  252. '   mdiMain
  253. 'Procedure:
  254. '   Load
  255. 'Modifications:
  256. '   25/12/94   JBL     Build
  257. 'Description:
  258. '   Set form size, set 3d dialogs, open the default database, set the title
  259. '======================================================================
  260. Sub MDIForm_Load ()
  261.     Dim iRetVal, iCount As Integer
  262.     Dim sRetVal As String
  263.     'General Error Handler
  264.     If Not bDesignMode() Then
  265.         On Error GoTo Error_mdiMain_Load_Error
  266.     End If
  267.     Width = 640 * Screen.TwipsPerPixelX
  268.     Height = 480 * Screen.TwipsPerPixelX
  269.     'centre this form within the screen
  270.     centre Me, Nothing
  271.     Tag = "mdiMain"
  272.     'load the toolbar icons
  273.     PicClip1.Picture = LoadPicture(App.Path & "\toolbar.bmp")
  274.     If tGApp.sHelpFile = "" Then
  275.         'switch off the Help menu option
  276.         mdiMain!mnuHelp.Visible = False
  277.     End If
  278.     'init to show no database opened
  279.     tGApp.sDbaseName = ""
  280.     'try and load the name of the database used last time
  281.     GetDefaultDb
  282.     If tGApp.sDbaseName <> "" Then
  283.         'set the form title
  284.         SetTitle mdiMain
  285.     Else
  286.         ClearTitle mdiMain
  287.     End If
  288.     'set up the toolbar
  289.     For iCount = 0 To tGApp.iToolButtonCount - 1
  290.         Toolbar(iCount).Outline = False
  291.         Toolbar(iCount).Picture = PicClip1.GraphicCell(iCount)
  292.     Next
  293.     'if you use 3d dialogs in design mode and break the program
  294.     'flow for debugging, then quite often VB will cause a
  295.     'gpf.
  296.     If Not bDesignMode() Then
  297.         'try and use 3d dialogs
  298.         Ctl3D_Start
  299.     End If
  300.     Exit Sub
  301. Error_mdiMain_Load_Error:
  302.     'call the generic error handler
  303.     GenErrorHandler "mdiMain.frm - Load", Err, Error$
  304.     Resume Exit_mdiMain_Load_Error
  305. Exit_mdiMain_Load_Error:
  306. End Sub
  307. '======================================================================
  308. 'Form/Module:
  309. '   mdiMain
  310. 'Procedure:
  311. '   Unload
  312. 'Modifications:
  313. '   25/12/94   JBL     Build
  314. 'Description:
  315. '   Finish with help and switch off 3d dialogs
  316. '======================================================================
  317. Sub MDIForm_Unload (Cancel As Integer)
  318.     Dim iRetVal As Integer
  319.     'General Error Handler
  320.     If Not bDesignMode() Then
  321.         On Error GoTo Error_mdiMain_Unload_Error
  322.     End If
  323.     'finished with help
  324.     iRetVal = WinHelp(Forms(0).hWnd, tGApp.sHelpFile, HELP_QUIT, CLng(0))
  325.     'Unregister the Ctl3d functions
  326.     Ctl3D_End
  327. Exit_mdiMain_Unload_Error:
  328.     End
  329. Error_mdiMain_Unload_Error:
  330.     'call the generic error handler
  331.     GenErrorHandler "mdiMain.frm - Unload", Err, Error$
  332.     Resume Exit_mdiMain_Unload_Error
  333. End Sub
  334. Sub mnuFileCompact_Click ()
  335.     CompactDbase cmdialog1
  336. End Sub
  337. Sub mnuFileExit_Click ()
  338.     Unload Me
  339. End Sub
  340. Sub mnuFileNew_Click ()
  341.     NewDbase
  342. End Sub
  343. Sub mnuFileOpen_Click ()
  344.         
  345.     OpenDbase
  346. End Sub
  347. Sub mnuFileRepair_Click ()
  348.     RepairDbase cmdialog1
  349. End Sub
  350. Sub mnuHelpAbout_Click ()
  351.     fAbout.Show 1
  352. End Sub
  353. Sub mnuHelpContents_Click ()
  354.     Dim iRetVal As Integer
  355.     iRetVal = WinHelp(Forms(0).hWnd, tGApp.sHelpFile, HELP_INDEX, CLng(0))
  356. End Sub
  357. Sub mnuHelpOnHelp_Click ()
  358.     Dim iRetVal As Integer
  359.     iRetVal = WinHelp(Forms(0).hWnd, tGApp.sHelpFile, HELP_HELPONHELP, CLng(0))
  360. End Sub
  361. '======================================================================
  362. 'Form/Module:
  363. '   mdiMain.frm
  364. 'Procedure:
  365. '   mnuHelpOrderInformation
  366. 'Parameters:
  367. '   None
  368. 'Returns:
  369. '   None
  370. 'Modifications:
  371. '   26/12/94   JBL     Build
  372. 'Description:
  373. '   Uses write to show a file with order information
  374. '======================================================================
  375. Sub mnuHelpOrderInformation_Click ()
  376.     Dim i As Integer
  377.     Dim sCmd As String
  378.     'General Error Handler
  379.     If Not bDesignMode() Then
  380.         On Error GoTo Error_OrderInfo
  381.     End If
  382.     If tGApp.sOrderInfoFile <> "" Then
  383.         sCmd = "write.exe " & tGApp.sOrderInfoFile
  384.         i = Shell(sCmd, 1)
  385.     End If
  386.     Exit Sub
  387. Error_OrderInfo:
  388.     'call the generic error handler
  389.     GenErrorHandler "MAIN.BAS - OrderInfo()", Err, Error$
  390.     Resume Exit_OrderInfo
  391. Exit_OrderInfo:
  392. End Sub
  393. Sub mnuHelpSearch_Click ()
  394.     Dim iRetVal As Integer
  395.     iRetVal = WinHelp(Forms(0).hWnd, tGApp.sHelpFile, HELP_PARTIALKEY, "")
  396. End Sub
  397. Sub mnuWindowArrange_Click ()
  398.     Arrange ARRANGE_ICONS
  399. End Sub
  400. Sub mnuWindowCascade_Click ()
  401.     Arrange CASCADE
  402. End Sub
  403. Sub mnuWindowCloseAll_Click ()
  404.     CloseAllChildren
  405. End Sub
  406. Sub mnuWindowTileHoriz_Click ()
  407.     Arrange TILE_HORIZONTAL
  408. End Sub
  409. Sub mnuWindowTileVert_Click ()
  410.     Arrange TILE_VERTICAL
  411. End Sub
  412. Sub Toolbar_Click (Index As Integer)
  413.     'clear the helptip
  414.     HelpTip Index, lblHelpTip, 0, 0
  415.     'action this button
  416.     ToolbarAction Index
  417. End Sub
  418. Sub Toolbar_MouseMove (Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  419.     HelpTip Index, lblHelpTip, x, y
  420. End Sub
  421. Sub ToolbarPanel_MouseMove (Button As Integer, Shift As Integer, x As Single, y As Single)
  422.     lblHelpTip.Visible = False
  423. End Sub
  424.